<%@ Page Language="C#" MasterPageFile="~/DoctorForum.Master" AutoEventWireup="true"
    Codebehind="ViewSubForum.aspx.cs" Inherits="WebForum.ViewSubForum" Title="Doctor Forum" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <div class="forumTitle">
        <asp:Label ID="LabelForumTitle" CssClass="Title" runat="server" Text=""></asp:Label>
        -
        <asp:Label ID="LabelForumContent" CssClass="Desc" runat="server" Text=""></asp:Label>
    </div>
    <%--Topic--%>
    <div class="forumContent">
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" DataSourceID="ObjectDataSource1"
            PageSize="5" AutoGenerateColumns="False" ShowHeader="True" Width="100%">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        Topic Name</HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#"ViewTopic.aspx?id="+Eval("Id")%>'
                            Text='<%# DataBinder.Eval(Container.DataItem,"Title") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        Post Date</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="LabelDesc" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"PostDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        Modified Date</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="LabelDesc" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"ModifiedDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        User Post</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="LabelDesc" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"User.UserName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <%--DataSource for topics--%>
    <asp:ObjectDataSource ID="ObjectDataSource1" TypeName="WebForum.App_Data.TopicDataSource"
        SelectMethod="List" runat="server">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="0" Name="fID" QueryStringField="id" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
